<template>
  <div>
    <Card shadow>
        <Button type="primary" icon="plus-round">添加</Button>
        <Button type="primary" icon="edit">编辑</Button>
        <Button type="primary" icon="close-round">删除</Button>
    </Card>
    <template>
        <div>
            <Table border ref="selection" :columns="columns4" :data="data1"></Table>
            <Button @click="handleSelectAll(true)">Set all selected</Button>
            <Button @click="handleSelectAll(false)">Cancel all selected</Button>
        </div>
    </template>    
  </div>
</template>

<script>
export default {
        data () {
            return {
                columns4: [
                    {
                        type: 'selection',
                        width: 60,
                        align: 'center'
                    },
                    {
                        title: '计量单位编码',
                        key: '计量单位编码'
                    },
                    {
                        title: '计量单位名称',
                        key: '计量单位名称'
                    },
                    {
                        title: '备注',
                        key: '备注'
                    }
                ],
                data1: [
                    {
                        计量单位编码: 'John Brown',
                        计量单位名称: 18,
                        备注: 'New York No. 1 Lake Park',
                        date: '2016-10-03'
                    }
                ]
            }
        },
        methods: {
            handleSelectAll (status) {
                this.$refs.selection.selectAll(status);
            }
        }
    }
</script>

<style>
  
</style>